<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>transform属性</title>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: red;
            transition: all 2s;
            margin: 10px auto;
            transform: translateX(50px);
        }
        div:hover{
            /* transform: translateX(-100px); */
            /* X轴平移 */
            /* transform: translateY(-100px); */
            /* Y轴平移 */
            /* transform: translateX(-100px) translateY(-100px); */
            /* 左上角平移 */
            transform: translate(100px,100px);
            /* 右下角平移（简写） */
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>